package com.zjy.business.system.manager.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.github.pagehelper.PageInfo;
import com.zjy.business.system.domain.manager.query.ManagerListPageSysOperationQuery;
import com.zjy.business.system.domain.manager.vo.ManagerListPageSysOperationVo;
import com.zjy.business.system.domain.manager.vo.ManagerSysOperationTypeVo;
import com.zjy.business.system.manager.service.ManagerSysOperationService;
import com.zjy.web.domain.model.Result;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 后台管理-操作日志
 */
@RestController
@RequestMapping("/manager/sysOperation")
@RequiredArgsConstructor
@Slf4j
public class ManagerSysOperationController {

    final private ManagerSysOperationService operationService;

    /**
     * 分页查询操作日志
     */
    @GetMapping("/listPageOperation")
    @SaCheckPermission("system:sysOperation:pageList")
    public Result<PageInfo<ManagerListPageSysOperationVo>> listPageOperation(ManagerListPageSysOperationQuery query) {
        return Result.SUCCESS(operationService.listPageSysOperation(query));
    }

    /**
     * 业务类型列表查询
     * @return
     */
    @GetMapping("/typeDownList")
    public Result<List<ManagerSysOperationTypeVo>> typeDownList() {
        return Result.SUCCESS(operationService.typeDownList());
    }

}
